package com.hntest.entity;


/**
 * 分页实体类
 * @author ASUS
 *
 */
public class Pager {
	//
	private int currPage=1;//当前页数
	//
	private int pageSize=5;//每页大小
	//
	private int totalCounts;//总记录数
	//
	private int totalPages;//总页数

	public int getCurrPage() {
		return currPage;
	}

	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalCounts() {
		return totalCounts;
	}
	
	//当传入总记数后，算法自动计算出总页数
	public void setTotalCounts(int totalCounts) {
		this.totalCounts = totalCounts;
		this.totalPages=(this.totalCounts%this.pageSize==0)?
			(this.totalCounts/this.pageSize):
				(this.totalCounts/this.pageSize+1);
	}

	public int getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(int totalPages) {
		this.totalPages = totalPages;
	}
	
	
	
}
